﻿using UnityEngine;
using System.Collections;

public class Award : MonoBehaviour {

    public float speed = 100;
    	
	// Update is called once per frame
	void Update () {
        transform.Rotate(Vector3.forward * speed * Time.deltaTime);
	}

    public void OnTriggerEnter2D(Collider2D other)
    {
        if (other.transform.tag.Equals("Player"))
        {
            if (transform.tag.Equals("AwardRed"))
            {
                PlayManager.Instance.AddScore(10);
            }
            else if (transform.tag.Equals("AwardBlue"))
            {
                PlayManager.Instance.AddScore(20);
            }

            PlayManager.Instance.PlayCollectible();
            Object.Destroy(transform.gameObject);
        }      
    }

    
}
